var el = document.createElement('input')
el.type = "file"
el.style.position = "fixed"
el.style.left = "1000px"
el.onchange = e => {
  var file = e.target.files[0];
  var formData = new FormData();
  formData.append('file', file)
  var otijiourl = "http://devbmg.365jingxuan.com/admin/widget.images/upload?pid=0"
  $.ajax({
    type: "post",
    url: otijiourl,
    data: odata,
    dataType: 'json', //返回值类型 一般设置为json
    // contentType: "application/x-www-form-urlencoded; charset=utf-8",
    processData: false,  // jQuery不要去处理发送的数据
    success: function (res) {
      console.log(res);
    }, error: function () {
      console.log("后台处理错误");
    }
  })

}
document.querySelector('body').appendChild(el)
el.click()